package com.xyzwps.example.moment;

public sealed interface Segment {

    String value();

    int startPos();

    int endPos();


    record Token(String value, int startPos, int endPos) implements Segment {

        @Override
        public String toString() {
            return String.format("\n[TOKEN]\t%d - %d\tvalue='%s'", startPos, endPos, value);
        }
    }

    record Text(String value, int startPos, int endPos) implements Segment {
        @Override
        public String toString() {
            return String.format("\n(text)\t%d - %d\tvalue='%s'", startPos, endPos, value);
        }
    }
}
